const config = {};

// config.baseUrl = "http://a.shan666.com/";
// config.baseUrl = 'https://www.easy-mock.com/mock/5bf76e9c0756573d9cb013e3/test'
// config.baseUrl = window.location.origin + '/';
// config.baseUrl = "http://m.taojiji.com/";

config.baseUrl = window.location.hostname == 'localhost' ? "http://m.taojiji.com/" :  window.location.origin + '/';

config.apis = {
    getGoods: 'getGoods ',
    goods: 'goods',
    doubleTwelveGoodsList: 'DoubleTwelve/doubleTwelveGoodsList',
    indexCouponReceive: 'NewGuestCoupon/indexCouponReceive',
    goodsListCoupon: 'DoubleTwelve/doubleTwelveGoodsListCoupon',
    topGoodsList: 'DoubleTwelve/topGoodsList', 
    newYearHome: "NewYearShop/newYearHome",             // 年货节进入砸金蛋页面
    newYearShare: "/NewYearShop/newYearShare", // 年货节分享
    newYearCoupon: "index.php/NewYearShop/newYearCoupon",  // 年货节领券（注意此接口领全场全并且都是可以重复领取的）
    newYearGoods: "index.php/NewYearShop/newYearGoods", // 
    twelveGoodsListSpikephp: "index.php/DoubleTwelve/doubleTwelveGoodsListSpikephp",
};

function setApis(Objkey, baseUrl) {
    Object.keys(Objkey).forEach(key => {
        Objkey[key] = `${baseUrl}${Objkey[key]}`;
    });
}

setApis(config.apis, config.baseUrl);


config.apis = { 
    ...config.apis,
};

export default config;